package com.shiguiwu.springmybatis.spring.autowired;

import com.shiguiwu.springmybatis.spring.autowired.Generics.AService;
import com.shiguiwu.springmybatis.spring.autowired.Generics.BService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 *
 * 按类型找->通过限定符@Qualifier过滤->@Primary->@Priority->根据名称找（字段名称或者方法名称）
 * 源码 AutowiredAnnotationBeanPostProcessor
 * @description: 注解的自定注入
 * @author: stone
 * @date: Created by 2021/3/15 14:39
 * @version: 1.0.0
 * @pakeage: com.shiguiwu.springmybatis.spring.autowired
 */
public class AutowiredTests {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(AConfig.class);
        String[] beanDefinitionNames = applicationContext.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(applicationContext.getBean(beanDefinitionName));

        }

    }
}
